package pac;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.JCheckBox;

public class settings extends JFrame {

        private JPanel contentPane;
        private JTextField textField;

        public settings() {
                setTitle("Settings");
                setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                setBounds(100, 100, 270, 155);
                contentPane = new JPanel();
                contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
                setContentPane(contentPane);
                contentPane.setLayout(null);
                
                JLabel lblStockTicker = new JLabel("Update every (seconds):");
                lblStockTicker.setBounds(10, 24, 156, 14);
                contentPane.add(lblStockTicker);
                
                textField = new JTextField();
                textField.setBounds(163, 21, 86, 20);
                contentPane.add(textField);
                textField.setColumns(10);
                
                JButton btnAdd = new JButton("Save");
                btnAdd.setBounds(20, 83, 89, 23);
                btnAdd.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                                //Save the settings and close
                                close();
                        }
                });
                contentPane.add(btnAdd);
                
                JButton btnCancel = new JButton("Cancel");
                btnCancel.setBounds(142, 83, 89, 23);
                btnCancel.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                                //Close the window
                                close();
                        }
                });
                contentPane.add(btnCancel);
                
//                chckbxNewCheckBox = new JCheckBox("Always on top", onTop);
//                chckbxNewCheckBox.setBounds(10, 53, 252, 23);
//                chckbxNewCheckBox.addActionListener(new ActionListener() {
//
//                    @Override
//                    public void actionPerformed(ActionEvent e) { 
//                    	onTop = setOnTop();
//                    }
//            });
//                contentPane.add(chckbxNewCheckBox);
        }
        public void close(){
        this.dispose();
                
        }
     
        
}